// by Xeno
private ["_vehicle"];
#include "x_setup.sqf"

#define __Poss _poss = x_sm_pos select 0;
#define __PossAndOther _poss = x_sm_pos select 0;_pos_other = x_sm_pos select 1;

x_sm_pos = [[8854.8008,6289.3623,0], [8887.3379,6309.1772,0]]; // index: 5,   Officer in Kamyshovo
x_sm_type = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client) then {
	d_current_mission_text = "An enemy spy is undergoing surgery to disguise himself near Canto. Eliminate him!";
	d_current_mission_resolved_text = "The enemy spy is dead.  Anyone else craving steak all of a sudden?";
};

if (isServer) then {
	_officer = switch (d_enemy_side) do {
		case "EAST": {"Cow02"};
		case "WEST": {"Cow03"};
		case "GUER": {"GUE_Commander"};
	};
	__PossAndOther
	["shilka", 0, "uaz_grenade", 1, "uaz_mg", 2, _pos_other,1,100] spawn XCreateArmor;
	sleep 2.123;
	__GetEGrp(_newgroup)
	_sm_vehicle = _newgroup createUnit [_officer, _poss, [], 0, "FORM"];
	[_sm_vehicle] join _newgroup;
	allunits_add set [count allunits_add, _sm_vehicle];
	_fortress = "Land_Shed_Ind02" createVehicle _poss;
	_fortress setDir 180;
	__AddToExtraVec(_fortress)
	#ifndef __TT__
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTargetNormal}];
	#endif
	#ifdef __TT__
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTargetTT}];
	#endif
	sleep 2.123;
	_bpos = position _fortress;
	_sm_vehicle setPos _bpos;
	sleep 2.123;
	_leader = leader _newgroup;
	_leader setRank "COLONEL";
	_newgroup allowFleeing 0;
	_newgroup setbehaviour "AWARE";
	_leader disableAI "MOVE";
	sleep 2.123;
	["specops", 2, "basic", 1, _poss,100,true] spawn XCreateInf;
};

if (true) exitWith {};